package com.view.utils;

import java.awt.Font;
import java.awt.Insets;
import java.awt.SystemColor;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JButton;

import com.view.MainWindow;

import java.awt.Color;

public class PlaneButton extends JButton implements MouseListener {
	/**
	 * 
	 */
	private static final long serialVersionUID = -7356133238284516386L;

	/**
	 * Boton con propiedades.
	 */
	public PlaneButton(String matricula, int pasajeros, int turbocina){
		setForeground(Color.DARK_GRAY);
		setBackground(SystemColor.inactiveCaptionBorder);
		setToolTipText("Matricula: " + matricula + "\nPasajeros: " + pasajeros + "\nCombustible: " + turbocina);
		setIcon(MainWindow.iconoAvion);
		
		setBorder(null);
		setFocusPainted(false);
		setMargin(new Insets(0, 0, 0, 0));
		setContentAreaFilled(false);
		setBorderPainted(false);
		setOpaque(false);
		setFont(new Font("Tahoma", Font.PLAIN, 9));
		addMouseListener(this);
	}

	@Override
	public void mouseClicked(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseEntered(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
		setBorderPainted(true);
		setIcon(MainWindow.iconoChafa);
		/*
		setContentAreaFilled(true);
		setForeground(Color.BLACK);
		
		setOpaque(true);
		*/
	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		// TODO Auto-generated method stub
		setBorderPainted(false);
		setIcon(MainWindow.iconoAvion);
		/*
		setContentAreaFilled(false);
		setForeground(Color.DARK_GRAY);
		
		setOpaque(true);
		*/
	}

	@Override
	public void mousePressed(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	
}